<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.chanyachting.emall.util.*"%>
<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<div class="search_bar">
<script type="text/javascript">
<!--
	function gotoPage(currentPage) {
		document.newsactivityForm.onsubmit = "return false;";
		document.pageSelectForm.currentPage.value = currentPage;
		document.pageSelectForm.submit();
	}

	function gotoPage2() {
		var i = document.newsactivityForm.select6.value;
		document.pageSelectForm.currentPage.value = i;
		document.pageSelectForm.submit();
	}
//-->
</script>
<form id="pageSelect" name="pageSelectForm" method="post" action="${newsactivityForm.actionName}">
    <input name="currentPage" type="hidden" value="">
</form>

      <form id="newsactivityForm_1" name="newsactivityForm" method="post" action="searchNoticeNewsByChannel.do" onsubmit="return searchNews();">
        	<input name="keyword" type="text" id="textfield4" class="ss_keyword" value="${newsactivityForm.keyword}"/>
        	<input name="monthIndex" type="hidden"/>
        	<input name="timeIndex" type="hidden"/>
        	<input name="channelId" type="hidden" value="${newsactivityForm.channelId}"/>
        	<input name="subChannelId" type="hidden" value="${newsactivityForm.subChannelId}"/>
        	<input name="readNumsIndex" type="hidden"/>
            <input type="button" name="button3" id="button3" class="btn_search" value="搜索" onClick="searchNews();"/>
            <input type="button" name="button4" id="button4" class="btn_gjsearch" value="高级搜索" onclick="k('a');showButton();" />
            <div id="pagefy">
                ${newsactivityForm.selectionStr}
            </div>
      <!--高级搜索_start-->
		<div class="gj_search" id="a">
            <!--按年份_start-->
            <div id="test7" class="dropdown" tabIndex="7" title="sssss">
                <select name="month">
                    <option value="">按年份</option>
                    <option value="0000">不限</option>
                    <%
                    	int years = 1990;
                    	for(int i = 0;i < 30;i ++) {
                    %>
                    		<option value="<%=years %>"><%=years %>年</option>
                    <%
                    		years ++;
                    	}
                    %>
                </select>
            </div>
            <!--按年份_end-->
            <!--月份_start-->
            <div id="test8" class="dropdown" tabIndex="8">
                <select name="time">
                    <option value="">月份</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                </select>
            </div>
            <!--月份_end-->
            <input type="button" name="button5" id="button5" class="btn_search" value="搜索" onclick="searchNews();" />
	    </div>
	    
	  <!--高级搜索_end-->
	  </form>
    </div>
    <script type="text/javascript">
    
    var monthValue = "${newsactivityForm.monthIndex}";
    var timeValue = "${newsactivityForm.timeIndex}";

    if (monthValue != "") {
        document.newsactivityForm.month.selectedIndex = monthValue;
    }
    if (timeValue != "") {
        document.newsactivityForm.time.selectedIndex = timeValue;
    }

    function searchNews() {
        var searchWord = document.newsactivityForm.keyword.value;
        if (searchWord == "") {
            alert("请填写查询的关键字！");
            return false;
        } else {
            var startMonth = document.newsactivityForm.time.selectedIndex;
            var years = document.newsactivityForm.month.selectedIndex;
            
	        document.newsactivityForm.monthIndex.value = years;
	        document.newsactivityForm.timeIndex.value = startMonth;
	        document.newsactivityForm.submit();
        }
    }

    document.newsactivityForm.button5.style.display = "none";
    function showButton() {
        if (document.newsactivityForm.button3.style.display == "none") {
        	document.newsactivityForm.button3.style.display = "block";
        	document.newsactivityForm.button5.style.display = "none";
        } else {
        	document.newsactivityForm.button5.style.display = "block";
        	document.newsactivityForm.button3.style.display = "none";
        }
    }
    </script>